package com.shoulder.boot.acl.controller;

import com.shoulder.boot.acl.service.CaptchaService;
import com.shoulder.boot.acl.vo.CaptchaVo;
import com.shoulder.core.annotation.Anonymous;
import com.shoulder.core.api.ApiResult;
import com.shoulder.log.annotation.LogAnnotation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 验证码管理
 */
@RestController
@RequestMapping("/admin/api/v1/acl/captcha")
@AllArgsConstructor
public class CaptchaController {

    private final CaptchaService captchaService;

    /**
     * 生成验证码
     */
    @LogAnnotation(type = "生成验证码", record = false)
    @GetMapping
    @Anonymous
    public ApiResult<CaptchaVo> create() {
        CaptchaVo vo = captchaService.create();
        return ApiResult.ok(vo);
    }
}
